//当显示状态为 交易关闭的时候,字体为灰色--------------------------------------------------------------
var ps = document.querySelectorAll("p");
for(var i = 0; i < ps.length; i++) {
	if(ps[i].innerHTML == "交易关闭") {
		ps[i].style.color = "#848689";
	}
}

//点击标题时,显示下边框----------------------------------------------------------------------------
var lis = document.querySelectorAll(".title>ul>li");
for(var i = 0; i < lis.length; i++) {
	lis[i].addEventListener("click", function() {
		for(var j = 0; j < lis.length; j++) {
			lis[j].className = "";
		}
		this.className = "border";
	})
}

var but=document.querySelectorAll(".but>button");
console.log(but)
for(let i=0;i<but.length;i++){
	but[i].addEventListener("click",function(){
		for(var j=0;j<but.length;j++){
			but[j].className="";
			but[j].style.backgroundColor="#ffffff";
			but[j].style.color="#d62d31";
		}
		this.style.backgroundColor="#d62d31";
		this.style.color="#ffffff";
		if(i==0){
			var text=document.querySelectorAll(".number>p");
			for(var x=1;x<text.length;x+=2){
				console.log(x)
				if(true){
					text[x].parentNode.parentNode.style.display="block";
				}
			}
		}
		else{
			var text=document.querySelectorAll(".number>p");
			console.log(text)
			for(var x=1;x<text.length;x+=2){
				console.log(x)
				if(text[x].innerHTML!="待供货商发货"){
					text[x].parentNode.parentNode.style.display="none";
				}
			}
		}
	})
}
var backBtn=document.querySelector(".back");
backBtn.addEventListener("click",function(){
	history.back();
})
